

import request from '@/router/axios'

const prefix = '/rca/swckdistinctpayment'

export function fetchList(query) {
  return request({
    url: `${prefix}/page`,
    method: 'get',
    params: query
  })
}

export const tables = {
  // 下载模板
  template: (query)=>{
    return request({
      url: `${prefix}/exportTamplates`,
      method: 'get',
      responseType: 'blob',
      params: query
    })
  },
  // 查询已上传表
  toBeConfirmed: (query)=>{
    return request({
      url: `${prefix}/listConfirmTable`,
      method: 'get',
      params: query
    })
  },
  // 查询指定表状态
  check: (query)=>{
    return request({
      url: `${prefix}/listPreprocessing`,
      method: 'get',
      params: query,
    })
  },
  // 查询指定表数据
  list: (query)=>{
    return request({
      url: `${prefix}/listPreview`,
      method: 'get',
      params: query
    })
  },
  upload: (query)=>{
    return request({
      url: `${prefix}/saveBatch`,
      method: 'post',
      headers: {
        'Content-Type': 'multipart/form-data'
      },
      data: query,
      timeout: 3600000
    })
  },
  save: (query)=>{
    return request({
      url: `${prefix}/saveBatchOk`,
      method: 'get',
      params: query
    })
  },
  cancel: (query)=>{
    return request({
      url: `${prefix}/saveBatchCancel`,
      method: 'get',
      params: query
    })
  },
};
